-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add to PipelineExecutionRolePermissions to allow stack deletion #3213
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
chore: Release v0.8.0
chore: v0.8.1 Release
chore: Release v0.9.0
chore: Release v0.10.0
chore: Release v0.11.0
Releasing v0.12.0
SAM CLI v0.13 release
Release: Version 0.14.0
chore: Version bump SAM CLI to 0.14.1 (#1082)
Release: v0.14.2
v0.15.0 Release
chore(version): 0.16.0
Release v0.16.1
chore: v0.17.0
release: Version 0.18.0 (#1206)
release: 0.20.0
Revert "release: 0.20.0"
chore: Update version to 0.20.1
This reverts commit 2090431.
chore: Release SAM CLI v0.22
Release: 0.23.0
chore: v0.30.0
Release v0.31.0
Release v0.31.1
chore: 0.32.0 Release
Release v0.33.0
Why --- The `PipelineExecutionRole` is assumed by the `PipelineUser` when deploying CI/CD pipelines. This role doesn't have permission to delete stacks via `sam delete`. This means that any stacks created need to be deleted manually. In order to support automated stack deletions for feature branches, this role needs a few extra permissions. This change is needed to support the this PR in the sam pipeline templates: aws/aws-sam-cli-pipeline-init-templates#42 How --- - Add three additional IAM permissions which allow the `sam delete` command to work as expected in `PipelineExecutionRolePermissions`. Next Steps ---------- - After this is merged, [this PR in the Pipeline templates for GitHub Actions](aws/aws-sam-cli-pipeline-init-templates#42) can be merged.
aahung
approved these changes
Oct 6, 2021
aahung
suggested changes
Oct 6, 2021
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should add one permission BatchDeleteImage
to
- Fn::If:
- ShouldHaveImageRepository
- Effect: "Allow"
Action:
- "ecr:GetDownloadUrlForLayer"
- "ecr:BatchGetImage"
- "ecr:BatchCheckLayerAvailability"
- "ecr:PutImage"
- "ecr:InitiateLayerUpload"
- "ecr:UploadLayerPart"
- "ecr:CompleteLayerUpload"
Resource:
Fn::If:
- MissingImageRepository
- !GetAtt ImageRepository.Arn
- !Ref ImageRepositoryArn
Based on PR feedback, allow for this role to delete a list of ImageIds by adding `ecr:BatchDeleteImage` to the Pipeline role.
aahung
approved these changes
Oct 7, 2021
c2tarun
approved these changes
Oct 7, 2021
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Why
The
PipelineExecutionRole
is assumed by thePipelineUser
when deploying CI/CD pipelines.This role doesn't have permission to delete stacks via
sam delete
. This means that any stackscreated need to be deleted manually. In order to support automated stack deletions for feature
branches, this role needs a few extra permissions.
This change is needed to support the this PR in the sam pipeline
templates:
aws/aws-sam-cli-pipeline-init-templates#42
How
sam delete
command to work asexpected in
PipelineExecutionRolePermissions
.Next Steps
can be merged.
Which issue(s) does this change fix?
Why is this change necessary?
How does it address the issue?
What side effects does this change have?
Checklist
make pr
passesmake update-reproducible-reqs
if dependencies were changedBy submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.